<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.css" integrity="sha256-6cQIC71/iBIYXFK+0RHAvwmjwWzkWd+r7v/BX3/vZDc=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/green/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"sumumm.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="本文主要是蓝牙Mesh进阶——蓝牙Mesh网络分层的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:type" content="article">
<meta property="og:title" content="LV03-03-蓝牙Mesh进阶-01-蓝牙Mesh网络分层">
<meta property="og:url" content="https://sumumm.github.io/post/e36d9daa.html">
<meta property="og:site_name" content="苏木">
<meta property="og:description" content="本文主要是蓝牙Mesh进阶——蓝牙Mesh网络分层的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226124743207.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226125221358.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226125306867.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226125928158.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226130503833.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226130936325.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226131016057.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226131647411.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226221104338.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226221240895.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226223004193.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226131016057.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226223819871.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226224404148.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225023821.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225240843.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225510512.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225626993.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225744223.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225916193.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226230009609.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226230202730.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226230750963.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226230957892.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226231144596.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226231442066.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226231625958.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226231729272.png">
<meta property="article:published_time" content="2024-01-07T03:45:29.000Z">
<meta property="article:modified_time" content="2025-06-13T16:25:57.026Z">
<meta property="article:author" content="苏木">
<meta property="article:tag" content="LV21-天猫精灵IOT">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226124743207.png">


<link rel="canonical" href="https://sumumm.github.io/post/e36d9daa.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://sumumm.github.io/post/e36d9daa.html","path":"post/e36d9daa.html","title":"LV03-03-蓝牙Mesh进阶-01-蓝牙Mesh网络分层"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>LV03-03-蓝牙Mesh进阶-01-蓝牙Mesh网络分层 | 苏木</title>
  








    <script src="/js/browser_tools_disable.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.com/hexo-next-tags-plus@latest/lib/tag_plus.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">苏木</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">我的学习之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>苏木的家</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类页<span class="badge">42</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档页<span class="badge">673</span></a></li><li class="menu-item menu-item-flink"><a href="/flink/" rel="section"><i class="fa fa-link fa-fw"></i>友人帐</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81%E5%88%86%E5%B1%82%E4%BD%93%E7%B3%BB%E7%BB%93%E6%9E%84"><span class="nav-text">一、分层体系结构</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E5%90%84%E5%B1%82%E5%88%86%E6%9E%90"><span class="nav-text">二、各层分析</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-Bearer-Layer"><span class="nav-text">1. Bearer Layer  </span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-PDU"><span class="nav-text">1.1 PDU</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-%E5%B9%BF%E6%92%AD%E9%80%9A%E9%81%93"><span class="nav-text">1.2 广播通道</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-%E6%95%B0%E6%8D%AE%E9%80%9A%E9%81%93"><span class="nav-text">1.3 数据通道</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-4-%E6%80%BB%E7%BB%93"><span class="nav-text">1.4 总结</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-Network-Layer"><span class="nav-text">2. Network Layer  </span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-Network-PDU"><span class="nav-text">2.1 Network PDU</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-%E7%BD%91%E7%BB%9C%E5%8A%A0%E5%AF%86%E7%9A%84%E8%BF%87%E7%A8%8B"><span class="nav-text">2.2 网络加密的过程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-3-%E6%B6%88%E6%81%AF%E7%9A%84%E6%B7%B7%E6%B7%86"><span class="nav-text">2.3 消息的混淆  </span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-Lower-transport-Layer"><span class="nav-text">3. Lower transport Layer  </span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-%E6%95%B0%E6%8D%AE%E5%88%86%E5%8C%85"><span class="nav-text">3.1 数据分包</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-Lower-Transport-PDU"><span class="nav-text">3.2 Lower Transport PDU</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-Upper-transport-layer"><span class="nav-text">4. Upper transport layer</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-Access-Layer"><span class="nav-text">5. Access Layer  </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-Foundation-Model-layer"><span class="nav-text">6. Foundation Model layer  </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-Model-Layer"><span class="nav-text">7. Model Layer  </span></a></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="苏木"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">苏木</p>
  <div class="site-description" itemprop="description">莫道桑榆晚，为霞尚满天</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">673</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">43</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/sumumm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sumumm" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://sumumm.github.io/post/e36d9daa.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="苏木">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏木">
      <meta itemprop="description" content="莫道桑榆晚，为霞尚满天">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="LV03-03-蓝牙Mesh进阶-01-蓝牙Mesh网络分层 | 苏木">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          LV03-03-蓝牙Mesh进阶-01-蓝牙Mesh网络分层
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2024-01-07 11:45:29" itemprop="dateCreated datePublished" datetime="2024-01-07T11:45:29+08:00">2024-01-07</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">嵌入式开发</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/" itemprop="url" rel="index"><span itemprop="name">01HQ课程体系</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/" itemprop="url" rel="index"><span itemprop="name">LV21-天猫精灵IOT</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>9.4k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>34 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>本文主要是蓝牙Mesh进阶——蓝牙Mesh网络分层的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。</p>
<span id="more"></span>

<!-- Photo: https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/ -->

<details class="folding-tag" blue><summary> 点击查看使用工具及版本 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>Windows版本</td>        <td align="left">windows11</td>    </tr>    <tr>        <td align="center">Ubuntu版本</td>        <td align="left">Ubuntu22.04的64位版本</td>      </tr>    <tr>        <td align="center">VMware® Workstation 16 Pro</td>        <td align="left">16.2.3 build-19376536</td>      </tr>    <tr>        <td align="center">终端软件</td>        <td align="left">MobaXterm(Professional Edition v23.0 Build 5042 (license))</td>      </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看本文参考资料 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center">分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="center" rowspan="6">官方网站</td>        <td align="left"><a href="https://cn.aliyun.com/" target="_blank">阿里云</a></td>        <td align="left">阿里云官网主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.aliyun.com/product/iot/livinglink?spm=5176.28508143.J_4VYgf18xNlTAyFFbOuOQe.317.5421154acZniIL&scm=20140722.X_data-1da961ea118f5bb0e4b2._.V_1" target="_blank">阿里生活物联平台</a></td>        <td align="left">生活物联网平台(飞燕平台)主页</td>    </tr>    <tr>        <td align="left"><a href="https://iap.aligenie.com/?spm=0.7629140.0.0.2c611780Ty6tzg" target="_blank">AliGenie</a></td>        <td align="left">天猫精灵开放平台AliGenie主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.aliyun.com/product/iot/iot_instc_public_cn?spm=5176.28508143.J_4VYgf18xNlTAyFFbOuOQe.81.5421154au3ocqp&scm=20140722.X_data-9349178ba84cf028806a._.V_1" target="_blank">阿里物联网平台</a></td>        <td align="left">阿里物联网平台主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/" target="_blank">Bluetooth 技术网站</a></td>        <td align="left">蓝牙协议规范什么的可以来这里找</td>    </tr>    <tr>        <td align="left"><a href="https://www.telink-semi.com/" target="_blank">Telink</a></td>        <td align="left">Telink | Chips for a Smarter IoT (telink-semi.com)<br><a href="https://www.telink-semi.cn/" target="_blank">Telink中文官网</a></td>    </tr>    <tr>        <td align="center" rowspan="5">开发手册</td>        <td align="left"><a href="https://help.aliyun.com/zh/alios-things/" target="_blank">AliOS Things开发指南</a></td>        <td align="left">AliOS Things开发指南，这里是最新版本，可以直接从官网找到</td>    </tr>     <tr>        <td align="left"><a href="https://haas.iot.aliyun.com/aliosthings/index.html" target="_blank">AliOS Things开发指南</a></td>        <td align="left">AliOS Things应用开发指南，这里应该是3.3版本的完整开发文档</td>    </tr>    <tr>        <td align="left"><a href="https://gaic.alicdn.com/aic/h5_daily/test/aliosthings/3.0.13/index.html" target="_blank">AliOS Things开发指南(3.0)</a></td>        <td align="left">AliOS Things应用开发指南，这里应该是3.0版本的完整开发文档</td>    </tr>    <tr>        <td align="left"><a href="https://help.aliyun.com/product/123207.html?spm=a2c4g.11186623.6.540.114e60d84sF58G" target="_blank">生活物联网平台开发文档</a></td>        <td align="left">生活物联网平台（飞燕平台）开发文档<br><a href="https://help.aliyun.com/document_detail/180778.html?spm=a2c4g.123207.0.0.49556adcO5apvd" target="_blank">《设备端开发指南》</a></td>    </tr>    <tr>        <td align="left"><a href="https://doc-bot.tmall.com/docs/doc.htm?spm=0.7629140.0.0.7bf81780UN7WkQ&treeId=578&articleId=118057&docType=1" target="_blank">Wi-Fi IoT品类定义与功能开发</a></td>        <td align="left">天猫精灵IoT开放平台——Wi-Fi IoT品类定义与功能开发</td>    </tr>    <tr>        <td align="center" rowspan="3">硬件平台</td>        <td align="left"><a href="https://developer.aliyun.com/article/761644?spm=a2c6h.12873581.0.dArticle761644.1c1b589dRHgvcR&groupCode=genieaiot" target="_blank">mk3080 WiFi开发板</a></td>        <td align="left">WiFi开发板使用指南-阿里云开发者社区</td>    </tr>    <tr>        <td align="left"><a href="http://www.taichi-maker.com/homepage/esp8266-nodemcu-iot/esp8266-nodemcu-tutorial-index/" target="_blank">esp8266开发板</a></td>        <td align="left">一个教程：ESP8266-NodeMCU开发板详解-太极创客 (taichi-maker.com)</td>    </tr>    <tr>        <td align="left"><a href="https://wiki.telink-semi.cn/doc/ds/DS_TLSR8258-E_Datasheet%20for%20Telink%20BLE+IEEE802.15.4%20Multi-Standard%20Wireless%20SoC%20TLSR8258.pdf" target="_blank">TLSR8258 Datasheet</a></td>        <td align="left">Datasheet for Telink BLE + IEEE802.15.4 MultiStandard Wireless SoC TLSR8258</td>    </tr>    <tr>        <td align="center" rowspan="2">参考资料</td>        <td align="left"><a href="https://developer.aliyun.com/article/720516#" target="_blank">AliOS Things 3.0 应用开发指南</a></td>        <td align="left">这个只是一篇参考文章，里面是一些环境搭建相关的，可以参考</td>    </tr>    <tr>        <td align="left"><a href="https://info.support.huawei.com/info-finder/encyclopedia/zh/index.html" target="_blank">IP知识百科 - 华为 (huawei.com)</a></td>        <td align="left">IP的一些相关知识点</td>    </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看相关文件下载 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="left" rowspan="6">蓝牙规范相关文档</td>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/core-specification-5-2/" target="_blank">Core Specification 5.2</a></td>        <td align="left">核心规格 5.2，该规范定义了创建可互操作的Bluetooth 设备所需的技术。                        <br><a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/mesh-model-1-1/" target="_blank">Mesh Model(v1.1)</a></td>        <td align="left">本Bluetooth 规范定义了模型（以及它们所需的状态和消息），这些模型用于在mesh 网络中的节点上执行基本功能，超出了Bluetooth Mesh 配置文件 规范中定义的基础模型。                        <br>本规范包括定义跨设备类型标准功能的通用模型，以及支持关键mesh 场景的模型，如照明控制、传感器、时间和场景。                        <br><a href="./蓝牙参考资料/MshMDL_v1.1.pdf" target="_blank">《MshMDL_v1.1.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/mesh-profile-1-0-1/" target="_blank">Mesh Profile(v1.0.1)</a></td>        <td align="left">该Bluetooth 规范定义了基本要求，以实现可互操作的mesh 网络解决方案，用于Bluetooth 低能量无线技术。                        <br><a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/device-properties/" target="_blank">Mesh Device Properties</a></td>        <td align="left">本规范包含Bluetooth Mesh 配置文件 和Bluetooth Mesh 模型规范所要求的设备属性的定义。                        <br>但是跟之前的有些区别，我主要看的之前的版本：<a href="./蓝牙参考资料/MeshDeviceProperties_v1.2.pdf" target="_blank">《MMeshDeviceProperties_v1.2.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/specifications/gss/" target="_blank">GATT Specification Supplement</a></td>        <td align="left">GATT Specification Supplement | Bluetooth® Technology Website。                        <br>好像可以在线看：<a href="https://btprodspecificationrefs.blob.core.windows.net/gatt-specification-supplement/GATT_Specification_Supplement.pdf" target="_blank">《GATT Specification Supplement》</a></td>      </tr>     <tr>        <td align="left"><a href="https://www.bluetooth.com/specifications/assigned-numbers/" target="_blank">Assigned Numbers</a></td>        <td align="left">GATT的一些类型定义可以在这里找。</td>      </tr>    <tr>        <td align="left" rowspan="2">AliOS Things</td>        <td align="left"><a href="https://gitee.com/alios-things-admin/AliOS-Things" target="_blank">alios-things/AliOS-Things</a></td>        <td align="left">Gitee上的AliOSThings SDK源码仓库</td>      </tr>    <tr>        <td align="left"><a href="https://github.com/alibaba/AliOS-Things" target="_blank">alibaba/AliOS-Things</a></td>        <td align="left">GitHub上的AliOSThings SDK源码仓库</td>      </tr>    <tr>        <td align="left" rowspan="2">天猫精灵蓝牙Mesh协议栈</td>        <td align="left"><a href="https://github.com/alibaba-archive/genie-bt-mesh-stack" target="_blank">alibaba-archive/genie-bt-mesh-stack</a></td>        <td align="left">GitHub上的天猫精灵蓝牙Mesh协议栈源码仓库。<br>之前是在<a href="https://github.com/alibaba/genie-bt-mesh-stack"target="_blank">alibaba/genie-bt-mesh-stack</a>这个仓库。<br>写笔记的时候最新提交为<a href="https://github.com/alibaba-archive/genie-bt-mesh-stack/tree/faf523618a6a2560090fc423222b9db80984bb7a" target="_blank">faf523618a6a2560090fc423222b9db80984bb7a</a></td>      </tr>    <tr>        <td align="left"><a href="https://help.aliyun.com/document_detail/171552.html?spm=a2c4g.173310.0.0.55d6e992e8xJip" target="_blank">蓝牙Mesh设备开发指南</a></td>        <td align="left">阿里云生活服务平台开发手册——蓝牙设备开发一节中的内容</td>      </tr></table>
              </div>
            </details>


<p>在研究技术的时候，最规范的还要说是官方提供的协议说明文档，不至于让我们绕弯子，遗憾的是全英文手册看上去比较头疼，但是从事IT行业的谁又能不跨越这一关呢？接下来就从官方手册入手，逐一了解每一层的用途，为了更方便理解，这里按照图上的顺序进行一个一个的描述。</p>
<h1 id="一、分层体系结构"><a href="#一、分层体系结构" class="headerlink" title="一、分层体系结构"></a><font size=3>一、分层体系结构</font></h1><p>我们看一下<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的2.1 Layered architecture一节：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226124743207.png" alt="image-20231226124743207" style="zoom: 33%;" />

<h1 id="二、各层分析"><a href="#二、各层分析" class="headerlink" title="二、各层分析"></a><font size=3>二、各层分析</font></h1><h2 id="1-Bearer-Layer"><a href="#1-Bearer-Layer" class="headerlink" title="1. Bearer Layer  "></a><font size=3>1. Bearer Layer  </font></h2><p>本层次中需要知道数据到达Bearer Layer的时候数据格式是什么样子的，它是怎么交给上一层的，上一层的又是如何把数据交给这一层并且发送出去的呢？我们会了解Bearer Layer所承载的对象，Bluetooth Low Energy Core Specification对广播和GATT拿到的数据怎样进行识别和交给Bearer Layer层的。</p>
<h3 id="1-1-PDU"><a href="#1-1-PDU" class="headerlink" title="1.1 PDU"></a><font size=3>1.1 PDU</font></h3><p>在研究Bearer Layer数据格式的时候，不得不回顾一下BLE的广播通道，我们可以看<a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a>的Vol 2, Part A，2 FREQUENCY BANDS AND CHANNEL  ARRANGEMENT（384）：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226125221358.png" alt="image-20231226125221358" style="zoom: 50%;" />

<p>首先是信道，在蓝牙BLE中有40个信道，从上图可见，当K&#x3D;0则对应2402Mhz，k&#x3D;39则对应2482Mhz，在这些信道中又被分为3个广播信道和数据信道，如下图（<a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a> Vol 6, Part B，1.4.1 Physical channel indices）所示：  </p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226125306867.png" alt="image-20231226125306867" style="zoom: 67%;" />

<p>广播信道的index为37，38，39，但实际上他们对应的物理信道并不是相邻的，我们需要明白为什么这么做，这样做的目的就是为了蓝牙广播的健壮性，在广播的时候会选择三个相差较大的频段来进行数据广播达到抗干扰的能力，还有一个更重要的原因，蓝牙的广播通道避开了Wi-Fi的数据通道，蓝牙的数据通道和Wi-Fi存在重叠。</p>
<p>在知道了存在干扰或者与其他设备碰撞的信道后，我们需要对数据进行识别显然是重中之重，在BLE中也对此阐述过，<a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a>Vol 6, Part B，2.1 PACKET FORMAT FOR THE LE UNCODED PHYS：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226125928158.png" alt="image-20231226125928158" />

<p>蓝牙的空中数据包均为这种格式，广播通道和数据通道只有发送的具体内容（PDU）不同，对方设备发射的帧格式为：  </p>
<blockquote>
<p>Preamble：前导，前导的值取决于Access Address最低位的值</p>
<p>Access Address：接入地址，通过前导和接入地址的配合，保证了数据包为蓝牙数据包的结果</p>
<p>PDU：具体的数据</p>
<p>CRC：校验  </p>
</blockquote>
<h3 id="1-2-广播通道"><a href="#1-2-广播通道" class="headerlink" title="1.2 广播通道"></a><font size=3>1.2 广播通道</font></h3><ul>
<li>广播模式（ADV），也就是广播通道</li>
</ul>
<p>对于PDU来说，最为重要的就是它的类型，通过手册可以见的它的几种模式，对于蓝牙Mesh的广播包来说，一定是不可连接不可扫描的，所以需要选择一种不可扫描和不可连接的一种模式。  我们可以看一下<a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a>Vol 6, Part B，2.3 ADVERTISING PHYSICAL CHANNEL PDU：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226130503833.png" alt="image-20231226130503833" />

<p>PDU格式如上图，有一个16bits的header，剩下的是payload数据。数据头的格式可以看Figure2.5。我们继续看，当PDU type位0b0010的时候，广播包是不可被扫描的，我们看一下这种广播包的Payload，如上图Figure2.8所示，AdvA填充的是设备自己的地址，这个地址是随机的。通过上述内容，再来分析广播数据：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226130936325.png" alt="image-20231226130936325" style="zoom:50%;" />

<p>我们可以看一下<a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a>Vol 3, Part C，11 ADVERTISING AND SCAN RESPONSE DATA  FORMAT： </p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226131016057.png" alt="image-20231226131016057" style="zoom:50%;" />

<p>在之前的蓝牙BLE中，会把数据分为多个AD Structure，每一个都会有自己的独有的信息，比如第一个装的公司信息，第二个装的设备名字等等。把我们之前的31个数据，变成N个AD Structure，它的好处在于能将数据进行展示更容易理解，打个比方我们在扫描设备的时候就能得值它的厂商以及其他信息，来分析一下这个格式就能够清楚了。</p>
<p>一个AD Structure里面有31 octets个数据（31字节），可以看到前面的Length和AD Type占了2个，所以从上一层Network Layer  下来的数据其实只有29个。这里我感觉课程老师讲的有点问题，我感觉应该是32个字节（因为上面PDU的Payload数据是0-31），所以上一层应该是30字节数据才对，这里没有深入研究，先这样写，后面发现有问题再补充修改。</p>
<p>在图中可以看到AD Type，我们可以定制AD Type如果等于0x00c1代表厂商类型，后面的AD Data则代表具体厂商的名字，以此类推，我们可以在AD Type中添加定制化的信息，蓝牙Mesh的广播包就是根据这里进行区分的，蓝牙Mesh规定，一个数据包只有一个AD Strusture，同时指定了几种ADType，AD Type也决定了数据最终走向哪里。如下所示 ：</p>
<blockquote>
<p>AD Type &#x3D; 0x29 《PB-ADV》 代表入网广播包。</p>
<p>AD type &#x3D; 0x2A 《Mesh Message》代表普通数据包，比如我们的开灯、关灯均已这种形式发送。</p>
<p>AD type &#x3D; 0x2B 《Mesh Beacon》 信标包，比如入网要求发送的信标包，安全相关的信标包  。</p>
</blockquote>
<p>Bearer Layer层的核心数据就是AD Structure这个位置了，那我们如何知道AD Type类型的？  我们可以来这里找<a target="_blank" rel="noopener" href="https://www.bluetooth.com/specifications/assigned-numbers/">Assigned Numbers | Bluetooth® Technology Website</a>：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226131647411.png" alt="image-20231226131647411" />

<p>我们打开这个文档<a target="_blank" rel="noopener" href="https://www.bluetooth.com/wp-content/uploads/Files/Specification/Assigned_Numbers.pdf?v=1703599704069">Assigned Numbers (bluetooth.com)</a>，找到2.3 Common Data Types，这例会有AD type的定义和解释：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226221104338.png" alt="image-20231226221104338" style="zoom:50%;" />

<p>或者我们也可以去代码里找<a target="_blank" rel="noopener" href="https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/core/ad_types.yaml">bluetooth-SIG &#x2F; public &#x2F; assigned_numbers &#x2F; core &#x2F; ad_types.yaml — Bitbucket</a>：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226221240895.png" alt="image-20231226221240895" />

<h3 id="1-3-数据通道"><a href="#1-3-数据通道" class="headerlink" title="1.3 数据通道"></a><font size=3>1.3 数据通道</font></h3><ul>
<li>数据通道（GATT）</li>
</ul>
<p>数据通道的PDU格式，同样是一个Header + Payload，另外多出来一个MIC。广播PDU的Header内容是不可连接，可连接等等这些内容，然而数据通道的Header相对复杂了一些，我们可以看一下<a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a>Vol 3, Part C，2.4 DATA PHYSICAL CHANNEL PDU  ：</p>
 <img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226223004193.png" alt="image-20231226223004193" />

<p>数据通道的类型需要选择Data PDU，也就是LLID &#x3D; 0b01，LL Date PDU在文档中有如下描述：</p>
<blockquote>
<p>An LL Data PDU is a Data Channel PDU that is used to send L2CAP data. TheLLID field in the Header shall be set to either 0b01 or 0b10.</p>
<p>An LL Data PDU with the LLID field in the Header set to 0b01, and the Length field set to 0b00000000, is known as an Empty PDU. The master’s Link Layer may send an Empty PDU to the slave to allow the slave to respond with any Data Physical Channel PDU, including an Empty PDU.</p>
<p>An LL Data PDU with the LLID field in the Header set to 0b10 shall not havethe Length field set to 0b00000000.</p>
<p>Note: If the Link Layer receives an HCI ACL Data Packet with Data_Total_Length equal to 0b00000000 and Packet_Boundary_Flag set to 0b00 (i.e., a start fragment), then the Link Layer cannot simply transmit the fragment over the air but, instead, must combine it with one or more of the following continuation fragments to form a PDU with LLID set to 0b10 and nonzero length.  </p>
</blockquote>
<p>在上层抽象的时候，数据格式和广播通道的时候其实是一样的，同样是<a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a>Vol 3, Part C，11 ADVERTISING AND SCAN RESPONSE DATA  FORMAT的这张图：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226131016057.png" alt="image-20231226131016057" style="zoom:50%;" />

<p>这里的AD Type与广播包肯定是不一样的，我们打开这个文档<a target="_blank" rel="noopener" href="https://www.bluetooth.com/wp-content/uploads/Files/Specification/Assigned_Numbers.pdf?v=1703599704069">Assigned Numbers (bluetooth.com)</a>，找到3.4 GATT Services，这例会有对应的AD type的定义和解释：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226223819871.png" alt="image-20231226223819871" />

<p>在这里只有两个选择：  AD Type &#x3D; 0x1827 入网时使用；AD Type &#x3D; 0x1828 数据传输使用 。</p>
<h3 id="1-4-总结"><a href="#1-4-总结" class="headerlink" title="1.4 总结"></a><font size=3>1.4 总结</font></h3><p>Bearer Layer层的本质其实就是来区分AD Type，以此来决定这个AD Data要给上一层的谁，或者是上一层的数据拿下来之后是通过广播通道还是数据通道发送出去。就相当于是进行了一个数据包流向的判断。我们打开<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>找到3.3.1 Advertising bearer  ：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226224404148.png" alt="image-20231226224404148"  />

<p>GAP需要尽量保持100%扫描，两个连续包之间加上一个随机时间，避免碰撞，一般来说是10ms左右。GATT 可以自己查看手册 。</p>
<h2 id="2-Network-Layer"><a href="#2-Network-Layer" class="headerlink" title="2. Network Layer  "></a><font size=3>2. Network Layer  </font></h2><p>进入到本层之前，先回顾一下，数据到了Bearer Layer层的时候数据是什么样子了呢？一共有31字节的数据，其中包括长度（Length）、类型（AD Type）、数据（Data）。那么数据到了Network Layer层的时候，就只剩下29个字节的数据了，因为AD Type和Lenght没有必要传上来了，也就是像火箭一层一层剥离一样，接下来看下Netwrok Layer的数据格式，也就是剩余最多29字节的格式。  </p>
<h3 id="2-1-Network-PDU"><a href="#2-1-Network-PDU" class="headerlink" title="2.1 Network PDU"></a><font size=3>2.1 Network PDU</font></h3><p>我们看一下<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>找到3.4.4 Network PDU ：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225023821.png" alt="image-20231226225023821" style="zoom:80%;" />

<blockquote>
<p>IVI：此项和设备的存活周期有关，此数据和NID是裸漏在外面的未加密数据。是一个32位的值，用于保证网络层的数据加密和混淆的安全性和随机性。IVI与序列号（SEQ）一起组成了nonce，nonce是用于AES-CCM算法的输入参数，用于对网络层PDU进行加密和认证。IVI可以防止nonce的重复使用，从而提高网络层的安全性。</p>
<p>NID：决定CTL - Source Address（SRC）部分使用什么KEY去混淆，Destination Address（DST） - TransportPUD用什么KEY加密。是一个7位的值，用于标识用于保护网络层PDU的加密密钥和隐私密钥。</p>
<p>CTL：数据包是否为网络控制包，仅参在LNP节点和FRIEND节点使用，如果不是网络控制包则为信息包。是一个1位的值，用于区分网络层PDU（Protocol Data Unit）是访问消息（Access Message）还是控制消息（Control Message）。访问消息是用于传输应用层数据的，控制消息是用于实现网络层的管理功能的，比如创建和维护友谊（Friendship）和心跳（Heartbeat）。CTL的值也会影响网络层PDU的大小和NetMIC（Network Message Integrity Check）的长度。</p>
<p>TTL：消息寿命键值，7位最大128，决定了数据可以被转发多少次。TTL的作用是防止消息在网络中无限循环，同时也可以控制消息的传播范围和效率。TTL的值由消息的发布者设定，每个消息都有一个初始的TTL值，范围是0-127。当消息被中继节点转发时，TTL的值会减1（就发生在这一层中），当TTL的值为0时，消息不会再被转发。TTL的值也会影响消息的优先级，TTL越高的消息越优先被转发。</p>
<p>SEQ：序列，防中继攻击，该值始终在 + 1，让攻击者无法得值该序列，从而不能进行重复包攻击。SEQ的作用是保证每个消息的唯一性和时效性，避免消息被重复处理或滥用。</p>
<p>SRC：源地址。是一个16位的值，用于标识网络层PDU（Protocol Data Unit）的发送者。SRC的作用是让接收者知道消息的来源，以便进行回复或处理。</p>
<p>DST：目的地址。是一个16位的值，用于标识网络层PDU（Protocol Data Unit）的接收者。DST的作用是让发送者指定消息的目的地，以便进行广播或单播。DST的值可以是一个单播地址、一个组播地址或一个虚拟地址，不能是一个未分配的地址。DST的值也会影响消息的安全性和隐私性，因为它会与IVI（Initialization Vector Index）和SEQ（Sequence Number）一起组成nonce，nonce是用于AES-CCM算法的输入参数，用于对网络层PDU进行加密和认证。</p>
<p>TransportPDU：Transport数据。是网络层PDU（Protocol Data Unit）的一部分，用于承载上层传输层的数据或控制信息。TransportPDU的作用是实现网络层和上层传输层之间的数据交换，以及对数据进行分段和重组。</p>
<p>NetMIC：是网络层PDU（Protocol Data Unit）的一部分，用于保证网络层数据的完整性和认证性。NetMIC的作用是防止消息被篡改或伪造，从而提高网络的安全性和可靠性。</p>
</blockquote>
<p>了解了每个参数的意思，再来看下其中的混淆和加密的地方是如何做的。</p>
<h3 id="2-2-网络加密的过程"><a href="#2-2-网络加密的过程" class="headerlink" title="2.2 网络加密的过程"></a><font size=3>2.2 网络加密的过程</font></h3><p>我们看一下  我们看一下<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的3.8.6.3 Network key：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225240843.png" alt="image-20231226225240843" style="zoom:80%;" />

<p>其中k1、k2、k3为蓝牙Mesh提供的标准函数，通过手册一样可以找得到，它们在<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的3.8.2 Security toolbox  这一节：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225510512.png" alt="image-20231226225510512" />

<p>Network key通过k2函数可以生成三个参数，分别为NID、EncryptionKey（加密key）、PrivacyKey（隐私key），这也验证了上面的参数通过NID可以得到混淆和加密的算法。我们一定好奇那Network key是怎么得来的呢？这里做一个简单的解释，一个设备入网（Provisioning）之后就会拥有Network key，在相同的蓝牙Mesh网络里每个设备都会有相同的Network key，天猫精灵找队友，配网成功，你得设备会有一个Network key，天猫精灵同样会有一个一摸一样的Network key。拿到了EncryptionKey（加密key）、PrivacyKey（隐私key）就可以对数据进行加密了，如下图（<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的3.8.7.2 Network layer authentication and encryption）：  </p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225626993.png" alt="image-20231226225626993" style="zoom:80%;" />

<p>上图所示DST和TransportPDU（上一层的数据）通过Network Nonce 和刚才k2生成的Encryption key进行了AES-CCM加密，生成了下面的加密数据和完整校验数据，Network Nonce内容（<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的3.8.5.1 Network nonce）：  </p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225744223.png" alt="image-20231226225744223" style="zoom:80%;" />

<p>上述内容即网络加密的过程。  </p>
<h3 id="2-3-消息的混淆"><a href="#2-3-消息的混淆" class="headerlink" title="2.3 消息的混淆  "></a><font size=3>2.3 消息的混淆  </font></h3><p>我们看一下<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的3.8.7.3 Network layer obfuscation这一节的Figure 3.42：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226225916193.png" alt="image-20231226225916193" />

<p>Privacy key是之前通过Newwork key生成的，其中Privacy Random数据是上面所提到的加密完成后的数据，其余的数据包含明码数据通过亦或进行混淆，过程也在Mesh文档中阐述，反之解密，其中最主要的则是Privacy key 和 IV Index。  </p>
<p>我们看一下数据接收过程（<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的3.4.6.3 Receiving a Network PDU这一节的Figure 3.8）：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226230009609.png" alt="image-20231226230009609" style="zoom:50%;" />

<p>我们再看一下数据发送（<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的3.4.4 Network PDU这一节的Figure 3.7）：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226230202730.png" alt="image-20231226230202730" style="zoom: 80%;" />

<p>发送的过程在手册中没有流程图，只有文字描述，基本流程如下：</p>
<p>（1）设置IVI ，取Iv Index最低有效位。</p>
<p>（2）NID配置，取决于使用哪个Networkey生成的。</p>
<p>（3）SEQ 加 1。</p>
<p>（4）Source address 取决于发送的element的地址。</p>
<p>（5）Destination Address 填写你要发送的地址。</p>
<p>（6）MIC加密后生成的内容  </p>
<h2 id="3-Lower-transport-Layer"><a href="#3-Lower-transport-Layer" class="headerlink" title="3. Lower transport Layer  "></a><font size=3>3. Lower transport Layer  </font></h2><p>Lower transport Layer层主要的工作在与拆包和组包的功能，其中包含四种格式类型，需要掌握，在模型中还会接触到关于此内容相关的东西。  </p>
<h3 id="3-1-数据分包"><a href="#3-1-数据分包" class="headerlink" title="3.1 数据分包"></a><font size=3>3.1 数据分包</font></h3><p>我们看一下<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的3.5.3 Segmentation and reassembly这一节的Figure 3.14：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226230750963.png" alt="image-20231226230750963" />

<p>没有什么能比这一幅图更说明问题，在上图中，可以看到数据从Access Layer传输到Upper Transport Layer层，数据在Access PDU上增加了一个Trans MIC，在向下传输到Lower Transport Layer层，数据到达Lower Transport Layer层的时候被分为了两段，可以理解数据量较大的时候，数据运输过程就会被分开，好比我们买了一台大型设备，物流也是分开进行运输的，等数据全部到达的时候，在通过此图反向推回去将数据完成组合成Access PDU的内容。  </p>
<h3 id="3-2-Lower-Transport-PDU"><a href="#3-2-Lower-Transport-PDU" class="headerlink" title="3.2 Lower Transport PDU"></a><font size=3>3.2 Lower Transport PDU</font></h3><p>接下来我们来看一下四种格式类型，我们看一下<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的3.5.2 Lower Transport PDU这一节的Table 3.9：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226230957892.png" alt="image-20231226230957892" />

<p>具体的可以看手册，手册中有很详细的描述。</p>
<h2 id="4-Upper-transport-layer"><a href="#4-Upper-transport-layer" class="headerlink" title="4. Upper transport layer"></a><font size=3>4. Upper transport layer</font></h2><p>The upper transport layer takes an access payload from the access layer or an internally generated upper transport layer Control message and transmits those messages to a peer upper transport layer.</p>
<p>上层传输层从访问层获取访问负载或内部生成的上层传输层控制消息，并将这些消息传输给对等的上层传输层。</p>
<p>For messages from the access layer, encryption and authentication of the message is performed using an application key.This allows the receiving upper transport layer to authenticate received messages.</p>
<p>对于来自访问层的消息，使用应用程序密钥执行消息的加密和身份验证。这允许接收上层传输层对接收到的消息进行身份验证。</p>
<p>Transport Control messages that are internally generated by the upper transport layer are only encrypted and authenticated at the network layer</p>
<p>由上层传输层内部生成的传输控制消息仅在网络层进行加密和身份验证。</p>
<h2 id="5-Access-Layer"><a href="#5-Access-Layer" class="headerlink" title="5. Access Layer  "></a><font size=3>5. Access Layer  </font></h2><p>访问层定义了较高层应用程序如何使用较高层传输层。它定义了应用程序数据的格式；它定义和控制应用程序数据的加密和解密在上层传输层中执行；并且在将传入的应用程序数据转发到更高的层之前，它会检查传入的应用程序数据是否已经在正确的网络和应用程序密钥的上下文中被接收。  </p>
<p>通过翻译出来的比较晦涩难懂了，其实它对应的代码就是我们Model中的操作代码，下面我们来一点一点的学习。  </p>
<p>我们看一下<a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a>的3.7 Access layer：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226231144596.png" alt="image-20231226231144596" style="zoom:80%;" />

<p>从第一点可以得出，本层的数据均采用小段模型，随后阐述了Model标识符，每一个Model都有自己的唯一标识符，这个在代码中可以看见，添加模型的时候后面都会有一个ModelID，且在天猫精灵官方规范中也明确规定了不同产品不同功能对应的模型ID，模型ID的作用是什么呢？首先我们明确每个元素是可以添加多个Model的，通过地址能快速的找到元素，在通过ID快速找到对应的模型进行操作，另外需要考虑ID还可以起到防重复定义的问题，下图为追溯模型定义位置，可以看到被添加了模型ModelID，且为16bit。  </p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226231442066.png" alt="image-20231226231442066" />

<p>下图为厂商模型定义部分，其中0x01A8代表阿里巴巴，此后接天猫精灵文档时会有详细说明，该模型则采用了16bit厂商标识码和16bit的modelID的组合，共计32bit ：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226231625958.png" alt="image-20231226231625958" />

<h2 id="6-Foundation-Model-layer"><a href="#6-Foundation-Model-layer" class="headerlink" title="6. Foundation Model layer  "></a><font size=3>6. Foundation Model layer  </font></h2><p>基础Model，此层定义了配置和状态管理，消息和模型以及Mesh网络，该模型的体现在代码中，两个必填模型，如下图：  </p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-01-%E8%93%9D%E7%89%99Mesh%E7%BD%91%E7%BB%9C%E5%88%86%E5%B1%82/img/image-20231226231729272.png" alt="image-20231226231729272" />

<ul>
<li><p>BT_MESH_MODEL_CFG_SRV模型则为配置和状态管理的模型  。</p>
</li>
<li><p>BT_MESH_MODEL_HEALTH_SRV模型则为Mesh网路模型，可以从名字上看出来管理网络健壮性的。</p>
</li>
</ul>
<h2 id="7-Model-Layer"><a href="#7-Model-Layer" class="headerlink" title="7. Model Layer  "></a><font size=3>7. Model Layer  </font></h2><p>模型层定义了用于标准化典型用户场景操作的模型，这些模型在蓝牙Mesh Model规范或其他更高层规范中定义。更高层模型规范的例子包括照明和传感器的模型。</p>

    </div>

    
    
    

    <footer class="post-footer">




    <div>
        
            <div style="text-align:center;color: #ccc;font-size:14px;">
            ----------本文结束
            <i class="fas fa-fan fa-spin" style="color: #FF1493; font-size: 1rem"></i>
            感谢您的阅读----------
            </div>
        
    </div>





  
  <div class="my_post_copyright"> 
    <p><span>文章标题:</span><a href="/post/e36d9daa.html">LV03-03-蓝牙Mesh进阶-01-蓝牙Mesh网络分层</a></p>
    <p><span>文章作者:</span><a href="/" title="欢迎访问 《苏木》 的学习笔记">苏木</a></p>
    <p><span>发布时间:</span>2024年01月07日 - 11:45</p>
    <p><span>最后更新:</span>2025年06月14日 - 00:25</p>
    <p><span>原始链接:</span><a href="/post/e36d9daa.html" title="LV03-03-蓝牙Mesh进阶-01-蓝牙Mesh网络分层">https://sumumm.github.io/post/e36d9daa.html</a></p>
    <p><span>许可协议:</span><i class="fab fa-creative-commons"></i> <a rel="license" href= "https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
  </div>
  


          <div class="post-tags">
              <a href="/tags/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/" rel="tag"><i class="fa fa-tag"></i> LV21-天猫精灵IOT</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/f96bb716.html" rel="prev" title="LV03-03-蓝牙Mesh进阶-02-蓝牙Mesh配网流程">
                  <i class="fa fa-angle-left"></i> LV03-03-蓝牙Mesh进阶-02-蓝牙Mesh配网流程
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/ca5f5860.html" rel="next" title="LV03-02-蓝牙Mesh基础-02-蓝牙Mesh的一些基础知识">
                  LV03-02-蓝牙Mesh基础-02-蓝牙Mesh的一些基础知识 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2017 – 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">苏木</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">3.7m</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">225:26</span>
  </span>
</div>




    <span id="sitetime"></span>
    <script defer language=javascript>
        function siteTime()
        {
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /*==================================================
            Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year        - 作为date对象的年份，为4位年份值
            month       - 0-11之间的整数，做为date对象的月份
            day         - 1-31之间的整数，做为date对象的天数
            hours       - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes     - 0-59之间的整数，做为date对象的分钟数
            seconds     - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数
            ==================================================*/
            var t1 = Date.UTC(2017, 
                              5, 
                              19, 
                              0, 
                              0, 
                              0); //北京时间
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML="已在这里 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>



    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.umd.js" integrity="sha256-ytMJGN3toR+a84u7g7NuHm91VIR06Q41kMWDr2pq7Zo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>


  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


 
        <div id="click-show-text"
            data-mobile = false
            data-text = 富强,民主,文明,和谐,自由,平等,公正,法制,爱国,敬业,诚信,友善
            data-fontsize = 15px
            data-random= false>
        </div>
       

      
        <script async src=https://cdn.jsdelivr.net/npm/hexo-next-mouse-effect@latest/click/showText.js></script>
      

      
    




    <script async src="/js/fancybox_param.js"></script>





<!-- APlayer本体 -->



</body>
</html>
